<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		
		<link rel="stylesheet" type="text/css" href="../css/index%20(1).css" />
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/vant.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/ajax.js" type="text/javascript" charset="utf-8"></script>
		<script src="html5plus://ready"></script>
		<title></title>
		<style type="text/css">
		body{
			background-color: #fafafa;
		}
		#uppwd{
			margin-bottom: 10px;
		}
			#img>img {
				width: 70px;
				height: 70px;
				margin-top: 10px;
				margin-left: 10px;
				border-radius: 35px;
			}
			
			#span_right {
				margin-left: 20px;
			}
			
			#login {
				margin-top: 20px;
			}
			
			#one {
				background-color: red;
				height: 50px;
				
			}
			
			
			
			.van-nav-bar__title{
				color: white;
				font-size: 15px;
				padding-top: 5px;
			}
			.van-nav-bar .van-icon{
				color: white;
				
				padding-top: 10px;
			}
			.van-nav-bar__text{
				color: white;
				padding-top: 10px;
			}
			#info{
				margin-top: 20px;
				padding-left: 180px;
			}
			#dl{
			padding-left: 50px;
			padding-right: 50px;
			margin-bottom: 20px;
			margin-top: 20px;
		}
		</style>
	</head>

	<body>
		<div id="app">
			<van-row >
				<van-nav-bar left-arrow  title="地址" left-text="返回" right-text="删除"  id="one" @click-left="back" @click-right="Right"></van-nav-bar>
				<van-address-list v-model="chosenAddressId" :list="list" @add="addd"  ></van-address-list> 
					  
					
			</van-row>
			
			<van-row id="three">
				
				
			</van-row>
			
			
		</div>
		<script type="text/javascript">
			var key=localStorage.getItem("keys");
			console.log(key)
			ajax({
			url:"http://dsapi.ysd3g.com/API/MyShippingAddressList",
			dataType:"JSONP",
			data:{
				key:key
				
				
			},
			success:function(res){
				
				
				for(var i=0;i<res.Data.length;i++){
					
					app.list.push(res.Data[i]);
					
				}
				
				
			}
			
			});
			var app = new Vue({
				el: "#app",
				data: {
					chosenAddressId:"1",
					list: [
							
						  ]
						 
				}
				,methods:{
					back:function(){
						//window.location.href="users.html"
						plus.webview.open("index.html","ind")
					},
					addd:function(){
						//window.location.href="add-address.html"
						plus.webview.open("add-address.html","ind")
					},
					Right:function(){
						/* ajax({
						url:"http://dsapi.ysd3g.com/api/DeleteShippingAddress	",
						dataType:"JSONP",
						data:{
							key:key,
							addressId: this.chosenAddressId
							
							
						},
						success:function(res){
							console.log(res)
							
								app.list.splice(this.chosenAddressId,1);
							
							
							for(var i=0;i<res.Data.length;i++){
								
								app.list.remove(res.Data[i]);
								
							} 
							
							
						}
						
						}); */
					}
				}
			});
		</script>
	</body>

</html>